package dk.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ReturnData.ResponseData;

import dk.service.ApiService;

@RestController
@RequestMapping("/stuapi")
public class H5studentController {
	@Autowired
	ApiService apiservice;
	@PostMapping("SendMes")
	public ResponseData SendMes(@RequestBody String phone) {
		
		//return null;
		return apiservice.SendMes(phone);
	}
	@PostMapping("StuLogin")
	public ResponseData Login(String phone,String code,String UUidcode,String password) {
		
		return apiservice.StuLogin(phone,code,UUidcode,password);
	}
	@PostMapping("StuChangePassword")
	public ResponseData StuChangePassword(String oldpassword,String newpassword,Integer id) {
		return apiservice.StuChangePassword(oldpassword,newpassword,id);
	}
	@PostMapping("StuGetExamlist")
	public ResponseData StuGetExamlist() {
		return apiservice.GetExamList();
	}
	@PostMapping("StuGetExamlistById")
	public ResponseData StuGetExamlistById(Integer id) {
		return apiservice.GetExamListByid(id);
	}
	@PostMapping("StuGetSubject")
	public ResponseData StuGetSubject() {
		return apiservice.GetSubject();
	}
	@PostMapping("StuGetOptionlist")
	public ResponseData StuGetExamlist(Integer Subjectid,Integer OptionExamNum,Integer ShortAnswerExamNum,Integer studentid) {
		return apiservice.StuGetExamlist(Subjectid,OptionExamNum,ShortAnswerExamNum,studentid);
	}
}
